{% extends 'base.html' %}

{% block title %}
	Rockmaple's Blog -- 提交文章
{% end %}

{% block scripts %}

{% end %}

{% block sidebar %}
<div class="sidebar-block spacing">
  <div class="sidebar-block-inner">
    <h4 class="sidebar-block-header">操作</h4>
    <div class="sidebar-block-content">
      <ul class="sidebar-block-list">
	    <li class="selected">提交文章</li>
      </ul>
    </div>
  </div>
</div>
{% end %}

{% block main_content %}
<div id="main-content">
  <div id="breadcrumb">
	 <a href="/">首页</a> » 提交文章
  </div>
  <h2 class="common-title">提交文章</h2>
  <div id="message-area" class="message-error hidden">
  </div>
  <form id="add-entry-form" action="{{ request.path }}" method="POST">
  	{% if entry %}
		<input type="hidden" name="id" value="{{ entry.id }}"/>
  	{% end %}
    <div class="form-area">
      <div class="form-field-name">
          <label>标题：</label>
      </div>
      <div class="form-field">
         <span id="title-msg" class="hidden">标题不能为空</span>
         <input id="entry-title" type="text" name="title" class="input-big" style="width:95%" value="{{ escape(entry.title) if entry else '' }}"/>
      </div>
      <div class="form-field-name">
          <label>内容:</label>
      </div>
      <div class="form-field">
         <span id="markdown-msg" class="hidden">正文内容不能为空</span>
         <textarea id="entry-markdown" name="markdown" style="width:95%;height:300px;"> {{ escape(entry.markdown) if entry else '' }} </textarea>
      </div>
      <div class="form-field-name">
          <label>标签（以逗号分隔）:</label>
      </div>
      <div class="form-field">
         <input id="tags-input" type="text" name="tags" class="input-big" style="width:95%" value="{{ entry.tags_as_string if entry else '' }}"/>
      </div>
      <div class="form-field">
         <input type="submit" value="提 交"/>
      </div>
    </div>
	{{ xsrf_form_html() }}
  </form>
</div>
{% end %}